-
Notifications
You must be signed in to change notification settings - Fork 112
Fix useless logging in sockets.py #1679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
02640e6 to
bfc8374
Compare
- Fix literal string '{event}' in error logs (sockets.py lines 145, 163)
The string was not an f-string, so {event} was logged literally instead
of the actual event data. Changed to use %r format which calls repr()
to get useful debugging info (class name, id, source, timestamp).
- Fix model_dump() returning non-JSON-serializable objects (state.py)
The model_dump() method returns Python objects like UUID and enums
that appear as repr strings in logs (e.g., UUID('...'), <Enum.VALUE>).
Changed to use model_dump(mode='json') wrapped in json.dumps() for
proper JSON-serializable output.
Co-authored-by: openhands <[email protected]>
bfc8374 to
fdd3fc1
Compare
|
@OpenHands revert fix 2 and update the issue description. then make sure that ci passes. |
|
I'm on it! neubig can track my progress at all-hands.dev |
Co-authored-by: openhands <[email protected]>
|
I've completed the requested changes: Summary
Final ChangesThe PR now only contains the fix for the literal string logging issue in -logger.exception("error_sending_event:{event}", stack_info=True)
+logger.exception("error_sending_event: %r", event, stack_info=True)This ensures that error logs now include the actual event data (using PR Link: #1679 |
all-hands-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix correctly addresses the logging bug by using proper printf-style formatting with %r. Good catch on adding the space after the colon and making the bash event message more specific.
|
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
tofarr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍰
Summary
Problem: The error logging in
_send_event()and_send_bash_event()used a literal string"error_sending_event:{event}"instead of an f-string. This meant{event}was logged literally instead of the actual event data.@neubig can click here to continue refining the PR
Agent Server images for this PR
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdknikolaik/python-nodejs:python3.12-nodejs22golang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:d47c260-pythonRun
All tags pushed for this build
About Multi-Architecture Support
d47c260-python) is a multi-arch manifest supporting both amd64 and arm64d47c260-python-amd64) are also available if needed